<?php
	session_start();	
?>

<?php
	if( $_SESSION["admin"] != "" )
	{
?>

<a href="index.php?com=capbac"><b>List capbac</b></a> | <a href="index.php?com=capbac&func=add"><b>Add new capbac</b></a>
<br />
<?php
	include_once("process/capbac.php");	
	$capbac = new capbac();	
    $pager = new PS_Pagination($capbac->_connection, $capbac->GetListPaging(), 15, 5, "", "?com=capbac");
	$rs = $pager->paginate();

	$table = '<table width="70%" style="font-size:10pt;">
				<tr>
					<td align="center" colspan="5" height="50"><b style="font-size:12pt; color:Blue;">List capbac</b></td>
				</tr>
				<tr bgcolor="#996699" style=" font-weight:bold;">						
					<td style="padding:4px;">Name</td>
                    <td style="padding:4px;">Value</td>
					<td style="padding:4px;" align="center" width="70px" colspan="2"></td>
				</tr>';
     while($list = mysql_fetch_assoc($rs))
	{
		$table .= '	<tr bgcolor="#FFFFFF"  onMouseOver="this.bgColor = '."'#C0C0C0'".'" onMouseOut ="this.bgColor = '."'#FFFFFF'".'">
						
						<td style="padding:4px;">
							'.$list['capbac_name'].'
						</td>
                        	
						<td style="padding:4px;">
							'.$list['value'].'
						</td>
						<td align="center">
							<a style="color:#0033FF;" href="index.php?com=capbac&func=update&id='.$list['capbac_id'].'">
								Update
							</a>
						</td>
						<td align="center">
							<a onClick="'."return confirm('Do you want to delete this capbac ?')".'"  style="color:#0033FF" href="index.php?com=capbac&func=delete&id='.$list['capbac_id'].'">
								Delete
							</a>
						</td>
					</tr>';
            }
	//endforeach;
	$table .= '</table>';
	echo $table.'<br />';
	echo $pager->renderFullNav();
   }
   else
	{
		echo "<meta http-equiv='refresh' content='0; url=login.php' />";
	}
?>